import { request } from "@/utils/request.js"

/**
 * 获取当前用户信息
 * @param {*} data 
 * @returns Promise
 */
export function checkProxy(data) {
	return request({ url: "/user/checkProxy", data })
}
/**
 * 获取当前用户信息
 * @param {*} data 
 * @returns Promise
 */
export function getSchool(data) {
	return request({ url: "/school/getSchool", data })
}
/**
 * 获取学校信息
 * @param {*} data 
 * @returns Promise
 */
export function getSchoolList(data) {
	return request({ url: "/school/list", data })
}
/**
 * 获取Banner
 * @param {*} data 
 * @returns Promise
 */
export function getBanner(data) {
	return request({ url: "/banner/getBanner", data })
}
/**
 * 获取新闻信息
 * @param {*} data 
 * @returns Promise
 */
export function getNews(data) {
	return request({ url: "/news/getNews", data })
}
/**
 * 访问量增加
 * @param {*} data 
 * @returns Promise
 */
export function addView(data) {
	return request({ url: "/news/view", data, loading: true, method: 'POST' })
}
/**
 * 获取所有商品
 * @param {*} data 
 * @returns Promise
 */
export function getShop(data) {
	return request({ url: "/shop/getShop", data })
}
/**
 * 切换学校
 * @param {*} data 
 * @returns Promise
 */
export function switchSchool(data) {
	return request({ url: "/user/switchSchool", data, loading: true, method: 'POST' })
}
/**
 * 商品详情
 * @param {*} data 
 * @returns Promise
 */
export function shopDetail(data) {
	return request({ url: "/shop/detail", data, loading: true })
}
/**
 * 提交订单
 * @param {*} data 
 * @returns Promise
 */
export function submitShop(data) {
	return request({ url: "/shop/submit", data, loading: true, method: 'POST' })
}